<!doctype html>
<html>
    <head>
        <!-- meta -->
        <!-- meta -->
        <title>API</title>
        <!-- css -->
        <link href="../styles/examples.css" rel="stylesheet"/>
        <link href="../../source/styles/kendo.common.css" rel="stylesheet"/>
        <link href="../../source/styles/kendo.kendo.css" rel="stylesheet"/>
        <!-- css -->
        <!-- script -->
        <script src="../js/jquery.js"></script>
        <script src="../../source/js/kendo.core.js"></script>
        <script src="../../source/js/kendo.fx.js"></script>
        <script src="../../source/js/kendo.calendar.js"></script>
        <script src="../../source/js/kendo.data.js"></script>
        <script src="../../source/js/kendo.popup.js"></script>
        <script src="../../source/js/kendo.list.js"></script>
        <script src="../../source/js/kendo.dropdownlist.js"></script>
        <!-- script -->
    </head>
    <body>
        <!-- nav -->
        <!-- nav -->
        <!-- description -->
        <div class="description">API</div>
        <!-- description -->
        <div id="example" class="k-content">
            <div id="calendar"></div>

            <script>
                $(document).ready(function() {
                    $("#calendar").kendoCalendar();

                    var calendar = $("#calendar").data("kendoCalendar");
                    calendar.value(new Date());

                    var navigate = function () {
                        var value = $("#direction").val();
                        switch(value) {
                            case "up":
                                calendar.navigateUp();
                                break;
                            case "down":
                                calendar.navigateDown(calendar.value());
                                break;
                            case "past":
                                calendar.navigateToPast();
                                break;
                            default:
                                calendar.navigateToFuture();
                                break;
                        }
                    },
                    setValue = function () {
                        calendar.value($("#value").val());
                    };

                    $("#get").click(function() {
                        alert(calendar.value());
                    });

                    $("#value").kendoDatePicker({
                        change: setValue
                    });

                    $("#set").click(setValue);

                    $("#direction").kendoDropDownList({
                        change: navigate
                    });

                    $("#navigate").click(navigate);
                });
           </script>
           <div class="configuration" style="width: 210px">
               <span class="configHead">Configuration</span>
               <span class="configTitle">API Functions</span>
               <ul class="options">
                   <li>
                       <button id="get" class="k-button">Get value</button>
                   </li>
                   <li>
                       <input id="value" value="10/10/2000" style="float:none" />
                       <button id="set" class="k-button">Set value</button>
                   </li>
               </ul>
               <span class="configTitle">Navigation</span>
               <ul class="options">
                   <li>
                       <select id="direction" style="vertical-align: top; width: 120px; margin-bottom: 3px;">
                           <option value="up">upper view</option>
                           <option value="down">lower view</option>
                           <option value="past">past</option>
                           <option value="future" selected="selected">future</option>
                       </select>
                       <button id="navigate" class="k-button">Navigate</button>
                   </li>
               </ul>
           </div>
       </div>
        <!-- tools -->
        <!-- tools -->
    </body>
</html>
